<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/



//如果有版本控制的话，请复制以下代码，修改版本号;访问地址把v1换成设置的版本号即可
Route::prefix('v1')->namespace('V1')->group(function () {

    //前台接口
    Route::prefix('api')->namespace('Api')->middleware(['auth.box'])->group(function () {
        Route::any('user/getInfo', 'UserController@getInfo');//用户信息
        Route::any('user/getRouters', 'UserController@getRouters');//用户菜单

        Route::post('user/register', 'AuthController@register');//注册用户-user-api

        Route::get('games/cut/{id}', 'GamesController@cut');//游戏正式服切换

        Route::get('games/list/{type}', 'GamesController@list');//游戏列表查询






        Route::resource('game', 'GameController');//游戏管理
        Route::resource('database', 'DatabaseController');//数据库配置管理
        Route::resource('games', 'GamesController');//游戏管理(新)


        Route::post('user/submitAc', 'UserController@submitAc');//提交个人认证
        Route::post('user/updateUser', 'UserController@updateUser');//修改个人信息

        Route::post('user/updateSafePassword', 'UserController@updateSafePassword');//修改安全密码

        Route::get('user/getUserInfo', 'UserController@getUserInfo');//查询个人详情
        Route::get('user/getUserBank', 'UserController@getUserBank');//查询用户银行卡

        Route::get('user/getBankClassList', 'UserController@getBankClassList');//查询银行卡分类列表


        Route::post('son-user/add', 'SonUserController@Add');//增加子账号
        Route::post('son-user/list', 'SonUserController@List');//子账号列表
        Route::post('son-user/update', 'SonUserController@Update');//修改子账号
        Route::post('son-user/destroy', 'SonUserController@Destroy');//修改子账号

        Route::post('evaluating/add', 'EvaluatingController@Add');//申请评测
        Route::post('evaluating/game_class', 'EvaluatingController@GameClass');//版本类型
        Route::post('evaluating/game_type', 'EvaluatingController@GameType');//版本分类

        Route::post('evaluating/app_channel', 'EvaluatingController@AppChannel');//申请渠道

        Route::post('user-permission/info', 'UserPermissionController@Info');//用户权限详情
        Route::post('user-permission/update', 'UserPermissionController@Update');//修改(增加)用户权限
//        Route::post('user-permission/list', 'UserPermissionController@List');//用户权限列表


    });

    //不校验
    Route::prefix('api')->namespace('Api')->group(function () {


        Route::post('update-log/list', 'UpdateLogController@List');//日志列表
        Route::post('common-problem/list', 'CommonProblemController@List');//常见问题列表


        Route::post('common-config/info', 'CommonConfigController@Info');//开发者优势
        /*********公共接口开始***********/

        /*********公共接口结束***********/
        Route::any('auth/login', 'AuthController@login');//账户登录
        Route::any('auth/mobile_login', 'AuthController@mobile_login');//手机登录

        Route::any('auth/sendSms', 'AuthController@sendSms');//发送短信
        Route::post('auth/register', 'AuthController@register');//注册用户-user-api
        Route::post('auth/retpas', 'AuthController@retpas');//找回密码

        Route::get('news/agreement/', 'NewsController@details');//开发者协议

        Route::any('auth/logout', 'AuthController@logout');//退出登录
        Route::resource('advert', 'AdvertController');//广告管理

        Route::any('file/upload', 'FileController@upload');//文件上传
        Route::any('file/uploadAll', 'FileController@uploadAll');//文件上传


        Route::resource('system/notice', 'NoticeController');//公告管理


        Route::any('index', 'IndexController@index');//首页
        Route::any('site_config', 'ConfigController@site_config');//站点配置
        Route::any('news', 'NewsController@index');//新闻列表
        Route::any('news/details', 'NewsController@details');//新闻详情
        Route::any('credential', 'CredentialController@index');//资质列表
        Route::any('credential/details', 'CredentialController@details');//资质详情
        Route::any('product', 'ProductController@index');//产品列表
        Route::any('product/logs', 'ProductController@logs');//产品日志
        Route::any('jobs', 'JobsController@index');//岗位列表

        Route::post('system/info', 'ConfigController@info');//配置详情


    });
});
